/**
 *	This controller will work directly with Student module
 *	of the system. Tasks as cadastre of new student, list of
 *	students this controller will be the responsible
 */

/**
 * Utilizando Ajax com Java Server Faces
 */
jQuery(document).ready(function() {
	
	//Insert a mask at fields: mensadalidade value and personal Value
//	jQuery('#mensalidadeValue').mask('#.##0,00');
//	jQuery('#personalValue').mask('#.##0,00');
	 
	 var ufJS = jQuery('[id="formNewAluno:formNewAluno:j_idt43:uf_input"]');
	 //var ufJS = jQuery('#ufJS');
	 ufJS.change(function() {
		 
		 alert(jQuery(this).val());
		 
		 jQuery.ajax({
			crossDomain	: true,
			dataType	: 'json',
			data		: JSON.stringify(jQuery(this).val()),
			type		: 'get',
			url			: '/sga/cidadeController/list',
			success		: function(data , err) {
				alert('success');
			},
			failure		: function(err) {
				alert('error');
			}
		 });
		 
	 });
	
	jQuery('#teste').change(function() {
		alert('ok');
		var obj = GenericFunctions;
		obj.test();
	});
	
	
});
